<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .box1 {
        width: 300px;
        height: 300px;
        background-color: pink;
        margin-top: 10px;
        /* float: left; */
        /* position: absolute; */
        overflow: hidden;
      }

      .box2 {
        width: 100px;
        height: 100px;
        background-color: deeppink;
        margin-top: 50px;
      }
    </style>
  </head>
  <body>
    <!-- 外边距重叠 -->
    <div class="box1">
      <div class="box2"></div>
    </div>
  </body>
</html>
